<?php
/*------------------------------------------------------------------------
 # Sot Virtuemart Simple Silder  - Version 1.0
 # @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 # @Author: Sky Of Tech
 # @Websites: http://skyoftech.com
 # @Email: contactnum1@gmail.com
 # Copyright (C) 2010-2011 Sky Of Tech. All Rights Reserved.
 -------------------------------------------------------------------------*/

defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<div class="sotss-theme<?php echo $theme;?>">
<ul id="SotSimpleSlider_<?php echo $module->id;?>" class="sotss-skin-tango" >
	<?php foreach($items as $key=>$item): ?>
    	<li> 
			<div class="SotSimpleSlider_item" >
				
				<div class="media">
					<div class="media_content">
						<img src="<?php echo $item['thumb'];?>" alt="<?php echo $item['sub_title'];?>" />
						<div class="contentSlider">
							<?php if($showCaption):?>
								<div class="ss_title"><a href="<?php echo $item['link'];?>"><?php echo $item['sub_title'];?></a></div>
							<?php endif;?>
							<?php if($showDesc):?>
								<div class="ss_content">
									<?php echo $item['sub_content'];?>
								</div>
							<?php endif;?>	
							<?php if($showReadmore):?>
								<div class="ss_readmore">
									<a href="<?php echo $item['link'];?>" class="readmore"><?php echo JText::_('Read more ++');?></a>
								</div>
							<?php endif;?>
						</div>
					</div>	
				</div>
				
			</div> 
		</li>
	<?php endforeach; ?>
</ul>
</div>
<?php if($count_item>=1):?>
	<script type="text/javascript">
		var $thumb_height = <?php echo $thumb_height;?>;
		var $curr_top = 0;
		jSot(document).ready(function($) {						
			$('#SotSimpleSlider_<?php echo $module->id;?>').jcarousel({
				vertical: <?php echo ($displayType)?"true":"false"; ?>,
				start: 1,
				scroll: <?php echo $scrollItems;?>,
				visible: <?php echo $numberItems;?>,
				animation: 'normal',
				easing: 'swing',
				auto: parseInt(<?php echo $autoPlay;?>),
				wrap: 'circular',
				afterSlideCallback: callbackafternext_<?php echo $module->id;?>
			});
		});
		
		function callbackafternext_<?php echo $module->id;?>(){
			var $contentSlider = jSot('#SotSimpleSlider_<?php echo $module->id;?>').find('.contentSlider');
			jSot.each($contentSlider,function(key, val){
			var config = {    
				 over: function(){
				 	var $des_height = jSot(val).height();
					var $margin_top = $thumb_height - $des_height - 5; 
				 	$curr_top = parseInt(jSot(val).css('top'));
				 	jSot(val).animate({
						top:$margin_top
					  }, 500, function() {
						// Animation complete.
					  });
				 }, 
				 timeout: 500, 
				 out: function(){				 	
				 	jSot(val).animate({
						top:$curr_top
					  }, 500, function() {
						// Animation complete.
					  });
				 } 
			};
			jSot(val).hoverIntent(config);
		})
		
		}
		callbackafternext_<?php echo $module->id;?>();				
	</script>
	
<?php endif;?>
